package 设计模式.flyweeight;

/**
 * 享原类
 * @功能
 * @创建时间 2020/5/3
 */
public interface CheeseFlyWeight {
    void setColor(String color);
    String getColor();
    void display(Coordinate c);
}
class ConcreateChess implements CheeseFlyWeight{
    public ConcreateChess(String color) {
        this.color = color;
    }

    private String color;
    @Override
    public void setColor(String color) {

        this.color =color;
    }


    @Override
    public String getColor() {
        return this.color;
    }

    @Override
    public void display(Coordinate c) {
        System.out.println("棋子颜色"+color);
        System.out.println("棋子位置"+c.getX()+"---"+c.getY());
    }
}
